package liuliu.throughwaring.service;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;

import java.util.Timer;
import java.util.TimerTask;

import liuliu.throughwaring.control.task.QueryTask;

/**
 * Created by Administrator on 2015/12/28.
 */
public class NoticeService extends Service {
    Timer timer;

    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        timer = new Timer();
        timer.schedule(new TimerTask() {
            @Override
            public void run() {

            }
        }, 0, 60 * 1000);
        return super.onStartCommand(intent, flags, startId);
    }

    private void getNotice() {
        QueryTask task = new QueryTask(this);
        task.getNotice();
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        if (timer != null) {
            timer.cancel();
        }
    }
}
